package com.yzd.learnjava.enumerated;

public enum RoShamBo3 implements Competitor<RoShamBo3>{
	PAPAER{
		public Outcome compete(RoShamBo3 it) {
			switch (it) {
			default:
			case PAPAER: return Outcome.DRAW;
			case SCISSORS: return Outcome.LOSE;
			case ROCK: return Outcome.WIN;
			
			}
		}
	},
	SCISSORS{
		public Outcome compete(RoShamBo3 it) {
			switch (it) {
			default:
			case PAPAER: return Outcome.WIN;
			case SCISSORS: return Outcome.DRAW;
			case ROCK: return Outcome.LOSE;
			
			}
		}
	},
	ROCK{
		public Outcome compete(RoShamBo3 it) {
			switch (it) {
			default:
			case PAPAER: return Outcome.LOSE;
			case SCISSORS: return Outcome.WIN;
			case ROCK: return Outcome.DRAW;
			
			}
		}
	};
	
	public abstract Outcome compete(RoShamBo3 r);
	
	public static void main(String[] args) {
		RoShamBo.play(RoShamBo3.class, 20);
	}
}
